package com.smfx.yxt.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smfx.yxt.daoSqlserver.StudentSignUpMapper;
import com.smfx.yxt.model.StudentSignUp;
import com.smfx.yxt.page.Page;
import com.smfx.yxt.service.IStudentSignUpService;

@Service("schoolSignUpService")
public class StudentSignUpServiceImpl implements IStudentSignUpService {

	@Autowired
	private StudentSignUpMapper studentSignUpMapper;
	
	@Override
	public StudentSignUp selectByPrimaryKey(Integer id) {
		return studentSignUpMapper.selectByPrimaryKey(id);
	}

	@Override
	public int addAndUpdate(StudentSignUp record) {
		if(record.getId() == null) {
			return studentSignUpMapper.insertSelective(record);
		}
		record.setUpdateTime(new Date());
		return studentSignUpMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public List<StudentSignUp> selectListByPage(Page<StudentSignUp> page) {
		return studentSignUpMapper.selectListByPage(page);
	}

}
